import 'package:flutter/material.dart';

class OrderItemCase extends StatelessWidget {
  const OrderItemCase({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.all(10),
      child: Container(
        child: Column(
          children: [
            //顶部的订单信息
            const Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text('2024-08-15 21:49:48'),
                Text(
                  '待发货',
                  style: TextStyle(color: Colors.orange),
                )
              ],
            ),
            //中间商品信息
            Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Image.network(
                  'https://yanxuan-item.nosdn.127.net/a09de222ed32efa8ffe359b1d5780574.jpg',
                  width: 100,
                  height: 100,
                  fit: BoxFit.cover,
                ),
                const SizedBox(
                  width: 10,
                ),
                Expanded(
                  flex: 1,
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      const Row(
                        children: [
                          Expanded(
                              child: Text(
                            '茶水分离杯耐热隔热玻璃杯 茶水分离杯耐热隔热玻璃杯',
                            maxLines: 2,
                            overflow: TextOverflow.ellipsis,
                          )),
                          SizedBox(
                            width: 10,
                          ),
                          Text('x2')
                        ],
                      ),
                      const SizedBox(
                        height: 5,
                      ),
                      Container(
                        decoration: BoxDecoration(
                            color: Colors.yellow,
                            borderRadius: BorderRadius.circular(5)),
                        child: const Text(
                          '规格:白色240ml',
                          style: TextStyle(fontSize: 14, color: Colors.grey),
                        ),
                      ),
                      const SizedBox(
                        height: 5,
                      ),
                      const Text(
                        '￥119.5',
                        style: TextStyle(
                            color: Colors.red, fontWeight: FontWeight.bold),
                      )
                    ],
                  ),
                )
              ],
            ),
            SizedBox(
              width: double.infinity,
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.end,
                children: [
                  const Text('合计:￥400.0'),
                  const SizedBox(height: 5),
                  Container(
                    decoration:
                        BoxDecoration(border: Border.all(color: Colors.black)),
                    child: Container(
                        padding: const EdgeInsets.all(5),
                        child: const Text('再次购买')),
                  )
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
